package com.yan.domain;

import java.util.List;

/**
 * @author taoge
 * @Date 2024/8/23 17:08
 * @Description
 */
public class PageInfo<T> {
    // 数据信息
    private List<T> date;
    // 实际信息个数
    private Long countNum;

    public PageInfo(List<T> date, Long countNum) {
        this.date = date;
        this.countNum = countNum;
    }

    public PageInfo() {

    }

    public List<T> getDate() {
        return date;
    }

    public void setDate(List<T> date) {
        this.date = date;
    }

    public Long getCountNum() {
        return countNum;
    }

    public void setCountNum(Long countNum) {
        this.countNum = countNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PageInfo<?> pageInfo = (PageInfo<?>) o;

        if (date != null ? !date.equals(pageInfo.date) : pageInfo.date != null) return false;
        return countNum != null ? countNum.equals(pageInfo.countNum) : pageInfo.countNum == null;
    }

    @Override
    public int hashCode() {
        int result = date != null ? date.hashCode() : 0;
        result = 31 * result + (countNum != null ? countNum.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "PageInfo{" +
                "date=" + date +
                ", countNum=" + countNum +
                '}';
    }
    
}
